<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st/gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

require __DIR__ . '/api.php';
// miss路由11
Route::miss(function () {
    return 'Route Not Found!';
});
// 首页
Route::get('/', 'index/index');
// 测试实例数据库
Route::get('test', 'index/test');
// api接口无需token模块
Route::group('admin', function () {
    // 首页路由
    Route::group('index', function () {
        Route::any('login', 'admin.Index/login');
        Route::any('getWebConfig', 'admin.Index/getWebConfig');
    });
})->allowCrossDomain();
// 后端接口需token模块
Route::group('admin', function () {
    // 首页路由
    Route::group('index', function () {
        Route::any('getInfo', 'admin.Index/getInfo');
    });
    // 用户模块
    Route::group('member', function () {
        Route::any('getList', 'admin.Member/getList');// 获取用户列表
        Route::any('getPaymentList', 'admin.Member/getPaymentList');// 获取用户列表
        Route::any('getUserLevelArr', 'admin.Member/getUserLevelArr');// 获取用户等级
        Route::any('moveUser', 'admin.Member/moveUser');// 用户关系调整
        Route::any('delUser', 'admin.Member/delUser');// 禁用用户
        Route::any('editUser', 'admin.Member/editUser');// 禁用用户
        Route::any('getCouponList', 'admin.Member/getCouponList');// 获取发放优惠券列表
        Route::any('sendCoupon', 'admin.Member/sendCoupon');// 发放优惠券
    });
    // 管理用户模块
    Route::group('user', function () {
        Route::any('add', 'admin.User/add');// 添加用户
        Route::any('info', 'admin.User/info');// 获取用户信息
        Route::any('getUserList', 'admin.User/getUserList');// 获取用户列表
        Route::any('status', 'admin.User/status');// 启用，禁用
        Route::any('del', 'admin.User/del');// 删除用户
        Route::any('logout', 'admin.User/logout');// 退出登录
        Route::any('getUserInfo', 'admin.User/getUserInfo');// 退出登录
        Route::any('setUserInfo', 'admin.User/setUserInfo');// 退出登录
        Route::any('getAuthenticationList', 'admin.User/getAuthenticationList');// 实名认证模块
        Route::any('authenticationAudit', 'admin.User/authenticationAudit');// 实名认证模块
    });
    // 菜单模块
    Route::group('menu', function () {
        Route::any('getUserMenuList', 'admin.Menu/getUserMenuList');// 后台左侧菜单栏
        Route::any('getRoleMenuList', 'admin.Menu/getRoleMenuList');// 后台左侧菜单栏 根据角色获取菜单列表
        Route::any('getMenuList', 'admin.Menu/getMenuList');// 获取全部菜单列表
        Route::any('getRuleMenuList', 'admin.Menu/getRuleMenuList');// 配置菜单权限
        Route::any('getMenuInfo', 'admin.Menu/getMenuInfo');// 获取菜单信息
        Route::any('saveMenuInfo', 'admin.Menu/saveMenuInfo');// 修改菜单
        Route::any('add', 'admin.Menu/add');// 添加菜单
        Route::any('info', 'admin.Menu/info');// 菜单信息
        Route::any('del', 'admin.Menu/del');// 删除菜单
        Route::any('editRule', 'admin.Menu/editRule');// 配置角色规则
    });
    // 角色模块
    Route::group('role', function () {
        Route::any('add', 'admin.Role/add');// 添加角色
        Route::any('info', 'admin.Role/info'); // 角色信息
        Route::any('del', 'admin.Role/del');// 删除角色
        Route::any('saveRoleInfo', 'admin.Role/saveRoleInfo');//保存角色信息
        Route::any('getRoleList', 'admin.Role/getRoleList');// 获取角色列表
    });
    Route::group('roles', function () {
        Route::any('getRoleList', 'admin.Role/getRoleList');// 获取角色列表
    });
    // 区域模块
    Route::group('region', function () {
        Route::any('getProvinceList', 'admin.Region/getProvinceList');// 获取省列表
        Route::any('getCityList', 'admin.Region/getCityList');// 根据省id获取市列表
        Route::any('getAreaList', 'admin.Region/getAreaList');// 根据市id获取区县列表
        Route::any('getStreetList', 'admin.Region/getStreetList');// 根据市，区县id获取街道列表
        Route::any('getCommunityList', 'admin.Region/getCommunityList');// 根据街道id获取小区列表
    });
    // 商品模块
    Route::group('goods', function () {
        Route::any('getList', 'admin.Goods/getList');// 获取商品列表
        Route::any('add', 'admin.Goods/add');// 添加商品信息
        Route::any('edit', 'admin.Goods/edit');// 编辑商品信息
        Route::any('del', 'admin.Goods/del');// 更新商品状态
        Route::any('getCategoryArr', 'admin.Goods/getCategoryArr');// 获取分类
        Route::any('status', 'admin.Goods/status');// 上下架
    });
    // 积分商品模块
    Route::group('integralGoods', function () {
        Route::any('getList', 'admin.IntegralGoods/getList');// 获取商品列表
        Route::any('add', 'admin.IntegralGoods/add');// 添加商品信息
        Route::any('edit', 'admin.IntegralGoods/edit');// 编辑商品信息
        Route::any('del', 'admin.IntegralGoods/del');// 更新商品状态
        Route::any('status', 'admin.IntegralGoods/status');// 上下架
    });
    // 图片上传
    Route::group('image', function () {
//        Route::any('upload', 'admin.Image/upload');// 图片上传
        Route::any('uploadImg', 'admin.Image/uploadImg');// 图片上传
        Route::any('uploadImage', 'admin.Image/uploadImage');// 富文本图片上传
    });
    // 配置模块
    Route::group('config', function () {
        Route::any('setConfig', 'admin.Config/setConfig');// 网站配置
        Route::any('getConfigInfo', 'admin.Config/getConfigInfo');// 网站配置
    });
    // 文章
    Route::group('article', function () {
        Route::any('getList', 'admin.Article/getList');
        Route::any('add', 'admin.Article/add');
        Route::any('edit', 'admin.Article/edit');
        Route::any('del', 'admin.Article/del');
    });
    // 提现记录
    Route::group('finance', function () {
        Route::any('getWithdrawList', 'admin.Finance/getWithdrawList');
        Route::any('getTechWithdrawList', 'admin.Finance/getTechWithdrawList');
        Route::any('getBalanceList', 'admin.Finance/getBalanceList');
        Route::any('getTechBalanceList', 'admin.Finance/getTechBalanceList');
        Route::any('audit', 'admin.Finance/audit');
        Route::any('techAudit', 'admin.Finance/techAudit');
        Route::any('getBalanceType', 'admin.Finance/getBalanceType');// 余额变更类型
        Route::any('getIntegralType', 'admin.Finance/getIntegralType');//  积分变更类型
        Route::any('getIntegralList', 'admin.Finance/getIntegralList');//  积分变更记录

        Route::any('getPromotionRewardsList', 'admin.Finance/getPromotionRewardsList');//  直接奖励列表
        Route::any('getTeamList', 'admin.Finance/getTeamList');//  推广团队详情
    });
    // 订单
    Route::group('order', function () {
        Route::any('getOrderStatusArr', 'admin.Order/getOrderStatusArr'); // 获取订单状态
        Route::any('getOrderList', 'admin.Order/getOrderList'); //获取订单列表
        Route::any('sendGoods', 'admin.Order/sendGoods');  //订单发货
        Route::any('getOrderDetail', 'admin.Order/getOrderDetail'); //订单详情
        Route::any('exportOrderExcel', 'admin.Order/exportOrderExcel');
        Route::any('batchSendGoods', 'admin.Order/batchSendGoods');
        Route::any('cancel', 'admin.Order/cancelOrder');

        Route::any('afterSales', 'admin.Order/afterSales'); //售后处理
    });
    // 用户等级
    Route::group('user_level', function () {
        Route::any('getList', 'admin.UserLevel/getList');
        Route::any('add', 'admin.UserLevel/add');
        Route::any('edit', 'admin.UserLevel/edit');
        Route::any('del', 'admin.UserLevel/del');
    });
    // 店铺
    Route::group('shop', function () {
        Route::any('getList', 'admin.Shop/getList');
        Route::any('edit', 'admin.Shop/edit');
        Route::any('status', 'admin.Shop/status');
        Route::any('del', 'admin.Shop/del');
        Route::any('getShopList', 'admin.Shop/getShopList');
    });
    // 分类
    Route::group('category', function () {
        Route::any('getList', 'admin.Category/getList');
        Route::any('save', 'admin.Category/save');
        Route::any('del', 'admin.Category/del');
        Route::any('getCategoryArr', 'admin.Category/getCategoryArr');
    });
    // 日志
    Route::group('log', function () {
        Route::any('getList', 'admin.Log/getList');
        Route::any('clearLog', 'admin.Log/clearLog');
    });
//    // 技师管理
//    Route::group('tec', function () {
//        Route::any('getList', 'admin.Technician/getList');
//        Route::any('info', 'admin.Technician/info');
//        Route::any('edit', 'admin.Technician/edit');
//        Route::any('getLevelArr', 'admin.Technician/getLevelArr');
//        Route::any('pass', 'admin.Technician/pass');
//        Route::any('getApplyList', 'admin.Technician/getApplyList');// 申请列表
//        Route::any('techClockList', 'admin.Technician/techClockList'); // 打卡记录
//        Route::any('techEvaList', 'admin.Technician/techEvaList'); // 评价列表
//        Route::any('evaStatusChange', 'admin.Technician/evaStatusChange'); // 评价显示隐藏
//        Route::any('techAuthList', 'admin.Technician/techAuthList'); // 认证审核
//        Route::any('auth', 'admin.Technician/auth'); // 资料审核
//        Route::any('techSosList', 'admin.Technician/techSosList'); // 技师报警记录
//        Route::any('sosStatusChange', 'admin.Technician/sosStatusChange'); // 技师报警处理
//        Route::any('delTech', 'admin.Technician/delTech'); // 技师报警处理
//        Route::any('delSos', 'admin.Technician/delSos'); // 删除语音
//    });
//    // 技师等级
//    Route::group('tec_level', function () {
//        Route::any('getList', 'admin.TechnicianLevel/getList');
//        Route::any('add', 'admin.TechnicianLevel/add');
//        Route::any('edit', 'admin.TechnicianLevel/edit');
//        Route::any('del', 'admin.TechnicianLevel/del');
//    });
    // 优惠券
//    Route::group('coupon', function () {
//        Route::any('getGoodsArr', 'admin.Coupon/getGoodsArr');
//        Route::any('getList', 'admin.Coupon/getList');
//        Route::any('add', 'admin.Coupon/add');
//        Route::any('edit', 'admin.Coupon/edit');
//        Route::any('searchUser', 'admin.Coupon/searchUser');
//        Route::any('statusChange', 'admin.Coupon/statusChange');
//        Route::any('record', 'admin.Coupon/record'); //发放记录
//    });
    Route::group('sms', function () {
        Route::any('getList', 'admin.Sms/getList');
    });
})->allowCrossDomain()->middleware('auth');
